<SCRIPT type="text/javascript">
	function pannelMgr(idflag){
		$(".nav_tapWrap li").attr("class","nav_tapIthems");
		$("#"+idflag+"_bnt").attr("class","nav_tapIthems cur");
		$("#mainDiv>div").css("display","none");
		$("#"+idflag+"_div").css("display","block");
	}
	function repeatMgr(){
		if($("#isRepeat").is(":checked")){
			$("#repeatJustTime").attr("disabled",false);
			$("#repeatSpace").attr("disabled",false);
		}else{
			$("#repeatJustTime").attr("disabled",true);
			$("#repeatSpace").attr("disabled",true);
		}
	}
	function exchangeTab(){
		var runType = $("input[name='runCycle']:checked").val();
		if(runType=="day"){
			$("#run_space_tr").css("display","block");
			$("#run_datetype_tr").css("display","block");
			$("#run_time_tr").css("display","none");
			$("#space_unit").html("天");
		}else if(runType=="week"){
			$("#run_space_tr").css("display","block");
			$("#run_datetype_tr").css("display","block");
			$("#run_time_tr").css("display","block");
			$("#runWeekTime_div").css("display","block");
			$("#runMonthTime_div").css("display","none");
			$("#space_unit").html("周");
		}else{
			$("#run_space_tr").css("display","none");
			$("#run_datetype_tr").css("display","none");
			$("#run_time_tr").css("display","block");
			$("#runMonthTime_div").css("display","block");
			$("#runWeekTime_div").css("display","none");
			
		}
	}

	function runSpaceMgr(){
		$("input[name='runDates']").attr("checked",false);
		exchangeTab();
	}
</SCRIPT>

<div class="artCon" style="top: 17px; margin-left: 0px;">
	<div class="middleArt">
	<form method="post" data-toggle="form" action="/${orgi}/design/event/${parentid}/${id}/taskaddo.html" id="mainForm" class="form-horizontal">
		<div class="artMain">
			<div class="rs_layout_center">
				<div class="rs_layout">
					<div class="rs_layout_center">
						<div id="mainDiv" style="width:100%; height:100%; overflow:auto">
							<div id="time_div" style="padding:10px;">
								<table class="data_table_1">
									<tbody>
									<tr>
										<th valign="top" style="vertical-align: top;padding-top: 10px;">执行方式：</th>
										<td colspan="3" >
											<label ><input name="plantask" <#if !job??||(job ?? && job.plantask ?? && job.plantask)> checked="checked"</#if> value="1" type="radio"/>后台执行</label>
											<label ><input name="plantask" <#if job ?? && job.plantask ?? && !job.plantask> checked="checked"</#if> value="0" type="radio"/>手动执行</label>
										</td>
									</tr>
									<tr>
										<th valign="top" style="vertical-align: top;padding-top: 10px;">参数：</th>
										<td colspan="3" >
											<input type="text" class="span3" name="params" value="<#if taskinfo??>${taskinfo.params!''}</#if>"/><label>（如：name=admin,date=T）</label>
										</td>
									</tr>
									<tr>
										<th valign="top" style="vertical-align: top;padding-top: 10px;">类型：</th>
										<td colspan="3" >
											<label ><input onclick="runSpaceMgr()" name="runCycle" value="day" checked="checked" type="radio"/>每天</label>
											<label ><input onclick="runSpaceMgr()" name="runCycle" value="week"<#if taskinfo ?? && taskinfo.runCycle ?? && taskinfo.runCycle=='week'> checked="checked"</#if>  type="radio"/>每周</label>
											<label ><input onclick="runSpaceMgr()" name="runCycle" value="month"<#if taskinfo ?? && taskinfo.runCycle ?? && taskinfo.runCycle=='month'> checked="checked"</#if>  type="radio"/>每月</label>
										</td>
									</tr>
									<tr>
										<th valign="top" style="vertical-align: top;padding-top: 10px;">设置：</th>
										<td colspan="3" style="border: solid 1px #EEE;padding-left: 20px;">
											<table id="run_datetype_tr" class="data_table_1">
												<tbody>
													<tr>
														<th>日期类型：</th>
														<td colspan="3" >
															<label><input <#if taskinfo?? && taskinfo.datetypes??><#list taskinfo.datetypes as type><#if type=='0'>checked="checked"</#if></#list></#if> value="0" name="datetypes" type="checkbox" >工作日</label>
															<label><input <#if taskinfo?? && taskinfo.datetypes??><#list taskinfo.datetypes as type><#if type=='1'>checked="checked"</#if></#list></#if> value="1" name="datetypes" type="checkbox" >节日</label>
															<label><input <#if taskinfo?? && taskinfo.datetypes??><#list taskinfo.datetypes as type><#if type=='2'>checked="checked"</#if></#list></#if> value="2" name="datetypes" type="checkbox" >假日</label>
														</td>
													</tr>
												</tbody>
											</table>
											<table id="run_space_tr" class="data_table_1">
												<tbody>
													<tr>
														<th>运行间隔：</th>
														<td colspan="3" >
															<input name="runSpace" <#if  taskinfo ??>value="${taskinfo.runSpace!''}"<#else>value=""</#if> type="text" ><span id="space_unit">天</span>
														</td>
													</tr>
												</tbody>
											</table>
											<table  id="run_time_tr" class="data_table_1">
												<tbody>
													<tr>
														<th style="vertical-align: top;padding-top: 10px">于：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
														<td colspan="3" >
															
															<div id="runWeekTime_div" style="width: 100%">
																<label><input name="runDates" value="2" id="runDates2" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == '2' && taskinfo.runCycle == 'week'>checked="checked"</#if></#list></#if>/>周一</label>
																<label><input name="runDates" value="3" id="runDates3" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == '3' && taskinfo.runCycle == 'week'>checked="checked"</#if></#list></#if>/>周二</label>
																<label><input name="runDates" value="4" id="runDates4" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == '4' && taskinfo.runCycle == 'week'>checked="checked"</#if></#list></#if>/>周三</label>
																<label><input name="runDates" value="5" id="runDates5" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == '5' && taskinfo.runCycle == 'week'>checked="checked"</#if></#list></#if>/>周四</label>
																<label><input name="runDates" value="6" id="runDates6" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == '6' && taskinfo.runCycle == 'week'>checked="checked"</#if></#list></#if>/>周五</label>
																<label><input name="runDates" value="7" id="runDates7" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == '7' && taskinfo.runCycle == 'week'>checked="checked"</#if></#list></#if>/>周六</label>
																<label><input name="runDates" value="1" id="runDates1" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == '1' && taskinfo.runCycle == 'week'>checked="checked"</#if></#list></#if>/>周日</label>
															
															</div>
															<div id="runMonthTime_div"  style="width: 100%">
																<select name="runBeginDate">
																<#list 1..31 as a>
																<option value="${a}" <#if taskinfo?? && taskinfo.runBeginDate?? && taskinfo.runBeginDate == a>selected='selected'</#if>>${a}</option>
																</#list>
																</select>日<br/>
																<#list 1..12 as a>
																<label><input name="runDates" id="runDatesM${a}" value="${a}" type="checkbox" <#if taskinfo?? && taskinfo.runDates??><#list taskinfo.runDates as days><#if days == a?string  && taskinfo.runCycle == 'month'>checked="checked"</#if></#list></#if>/>${a}月</label>
																</#list>
															</div>
														</td>
													</tr>
												</tbody>
											</table>
											<table class="data_table_1">
												<tbody>
													<tr>
														<th>开始时间：</th>
														<td colspan="3" >
															<select name="runBeginHour">
																<#list 0..23 as a>
																<option value="${a}" <#if  taskinfo ??&&taskinfo.runBeginHour??><#if a==taskinfo.runBeginHour> selected </#if></#if>><#if a < 10 >0</#if>${a}</option>
																</#list>
															</select>：
															<select name="runBeginMinute">
																<#list 0..59 as a>
																<option value="${a}" <#if  taskinfo ??&&taskinfo.runBeginMinute??><#if a==taskinfo.runBeginMinute> selected </#if></#if>><#if a < 10 >0</#if>${a}</option>
																</#list>
															</select>：
															<select name="runBeginSecond">
																<#list 0..59 as a>
																<option value="${a}" <#if  taskinfo ??&&taskinfo.runBeginSecond??><#if a==taskinfo.runBeginSecond> selected </#if></#if>><#if a < 10 >0</#if>${a}</option>
																</#list>
															</select>
														</td>
													</tr>
													<tr>  
														<th colspan="4"><label><input onclick="repeatMgr()" id="isRepeat" name="isRepeat"  <#if taskinfo ?? && taskinfo.isRepeat?? && taskinfo.isRepeat?string("true","false")=="true"> checked </#if>value="1" type="checkbox"/>在该日内重复 </label></th>
													</tr>
													<tr>
														<th>间隔：</th>
														<td colspan="3" >
															<input <#if  taskinfo ?? && taskinfo.isRepeat?? && taskinfo.isRepeat?string("true","false")=="false">  disabled="disabled" </#if> id="repeatSpace" name="repeatSpace" <#if  taskinfo ??>value="${taskinfo.repeatSpace!''}"</#if> type="text">分钟
														</td>
													</tr>
													<tr>
														<th>持续时间：</th>
														<td colspan="3" >
															<input <#if taskinfo ?? && taskinfo.isRepeat?? && taskinfo.isRepeat?string("true","false")=="false">  disabled="disabled" </#if>  id="repeatJustTime" name="repeatJustTime" <#if  taskinfo ??>value="${taskinfo.repeatJustTime!''}"</#if> type="text">分钟
														</td>
													</tr>
												</tbody>
											</table>
										</td>
									</tr>
									<script>
										exchangeTab();
									</script>
								</tbody></table>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="bottomBg">
				<div class="btnWrap">
					<input type="submit" class="subButtonStyle" value="确认"/>
					<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
				</div>
			</div>
		</div>
		</form>
	 </div>
</div>